PrPicFile
void PrPicFile(hPrtRec, pPrPort, pIOBuf, pDevBuf, pPrStatus ); Ptr pIOBuf ; address of an I/O buffer; 0=allocate one Ptr pDevBuf ; address of a device buffer; 0=allocate one PrPicFile prints a file previously spooled to disk. Call this function if, after closing a document, you find that the print record's prJob.bJDocLoop
field indicates that the printing was spooled.
hPrtRec is a handle leading to a 120-byte TPrint structure. This should be a valid printing record containing information set via PrStlDialog, pPrPort is the address of a 178-byte TPrPort record or 0 if you want Note: Don't use the value returned from a call to PrOpenDoc unless you allocated the structure yourself ( otherwise, PrCloseDoc will have disposed the printing grafPort memory).
pIOBuf is the address of a 522-byte buffer to be used for I/O operations or
0 if you want PrPicFile to use an existing volume buffer. pDevBuf is the address of a device-dependent buffer used in the printing
process or 0 if you want the call to allocate one. If you pass a
non-NIL value, the buffer must be the size found in the
prXInfo.iDevBytes field of the TPrint structure identified by hPrtRec.
pPrStatus is the address of a 26-byte TPrStatus structure. As the printing progresses, this structure will receive updates as to the current
page, and copy. If you have a background procedure, you can monitor
this structure to keep the user informed.
Notes: Normal usage is to pass NIL for pPrPort, pIOBuf, and pDevBuf; e.g.:
TPrStatus pPrStatus; [TOKEN:12074] make a 26-byte area */ Since the device buffer can tend to be very large, we are warned to shrink
our code and data areas as small as possible. This will typically involve call
to UnloadSeg (to allow code segments to be purged) and all possible resource unlocking and memory disposing.
If you wish to monitor the printing progress, just store the address of a
procedure in the print record's prJob.pIdleProc field before calling
pascal void MyIdleProc(); /* pre-define the custom proc */
(*hPrtRec)->prJob.pIdleProc = MyIdleProc;
Your custom background task will be called at every opportunity. If you
use Quickdraw to display the status on the screen, be sure to call SetPort to the desired window before drawing and set it back to pPrPort before
returning.
Note: Don't attempt to print from your background routine. The Printing
Manager is NOT reentrant.
If the user clicks a Cancel button or presses -period, you can abort
the printing by calling PrSetError. If you don't install a custom routine, the default routine monitors for -period and sets the global variable
PrintErr to iPrAbort (128)